<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<div id="example"></div>
		<script src="../js/react.development.js"></script>
		<script src="../js/react-dom.development.js"></script>
		<script src="../js/babel.min.js"></script>
		<script src="../js/prop-types.js"></script>
		<script type="text/babel">
			class MyComponent extends React.Component {
				constructor(props) {
					super(props);
					this.hanldeClick = this.hanldeClick.bind(this);
					this.handleBlur = this.handleBlur.bind(this);
				}
				hanldeClick() {
					const input = this.refs.content;
					alert(this.input.value);
				}
				handleBlur(event) {
					console.log(event.target.value);
				}
				render() {
					return (
						<div>
							<input type="text" ref={(input) => (this.input = input)} />
							<button onClick={this.hanldeClick}>点击</button>
							<input
								type="text"
								onBlur={this.handleBlur}
								placeholder="失去焦点提示"
							/>
						</div>
					);
				}
			}

			ReactDOM.render(<MyComponent />, example);
		</script>
	</body>
</html>
